package com.example.basic;

public class ThreadState implements Runnable{
    @Override
    public void run() {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        ThreadState threadState = new ThreadState();
        Thread a = new Thread(threadState, "A");
        Thread b = new Thread(threadState, "B");
        System.out.println(a.getState());
        a.start();
        System.out.println(a.getState());
        System.out.println(a.getState());
    }
}
